package org.compression.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.model.auth.AccessIPStat;
import org.model.auth.Bussine;
import org.model.comm.Page;

@Mapper
public interface BussineMapper {
	int deleteByPrimaryKey(Integer id);

	int insert(Bussine record);

	int insertSelective(Bussine record);

	Bussine selectByPrimaryKey(Integer id);

	int updateByPrimaryKeySelective(Bussine record);

	int updateByPrimaryKey(Bussine record);

	@Select("select * from sm_bussine limit #{currentPageNum},#{pageSize}")
	public List<Bussine> getPageBussiness(Page mPage);


	@Select("select count(*) from sm_bussine")
	public long getTotal();


	@Select("select b.* from sm_bussine b,sm_usergroup ug where  ug.member_id =b.id and ug.group_id=3")
	public List<Bussine> getBussinetableDataRealte();

	@Select("select * from sm_bussine limit #{currentPageNum},#{pageSize}")
	public List<Bussine> getPageBussine(Page mPage);


	@Select("select * from sm_bussine where name like CONCAT('%',#{name},'%') ")
	public List<Bussine> selectName(Bussine mBussines);

	@Insert("insert into sm_bussine (name) values (#{name})")
	@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="id")
	public int insertBussine(Bussine mBussine); 

	@Insert("insert into sm_bussine (name,createdate,attr) values (#{name},#{createdate},#{attr})")
	@Options(useGeneratedKeys=true, keyProperty="id", keyColumn="id")
	public int insertBussineDate(Bussine mBussine); 






}